package com.fitso.wicket.panel.user;

import java.io.Serializable;

import org.apache.log4j.Logger;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.CompoundPropertyModel;

import com.fitso.model.bean.User;
import com.fitso.wicket.FitsoSession;
import com.fitso.wicket.config.SecureComponent;

/**
 * This is panel that is displayed once a user has been successfully logged in.
 * This panel gives them the ability to logout from whatever page has this
 * panel.
 * 
 * @author timothystorm
 */
@SecureComponent
public class UserSignOutPanel extends Panel implements Serializable {
	// Only change on breaking changes, i.e., removing fields
	private static final long serialVersionUID = 1L;

	static final Logger logger = Logger.getLogger(UserSignOutPanel.class);

	public UserSignOutPanel(final String id) {
		super(id, new CompoundPropertyModel<User>(FitsoSession.get().getUser()));

		logger.trace("building signOutPanel");
		add(new Label("firstName"));
		add(new Label("lastName"));
		add(new UserSignOutForm("UserSignOutForm"));
	}
}
